﻿using System;
using System.Text;

namespace dotHTML.HTML {
    /// <summary>
    /// Represents an unordered list.
    /// </summary>
    public class Ul : Element {
        /// <summary>
        /// Represents the types of delimiters that can be used for this list.
        /// </summary>
        public enum TypeChoices {
            /// <summary>
            /// The delimiter is a circle.
            /// </summary>
            Circle,
            /// <summary>
            /// The delimiter is a disc.
            /// </summary>
            Disc,
            /// <summary>
            /// The delimiter is a square.
            /// </summary>
            Square
        }

        private bool _compact;
        private TypeChoices? _type;

        /// <summary>
        /// Indicates that this list should be rendered in a compact
        /// representation.
        /// </summary>
        [Obsolete("Deprecated in HTML4 - use CSS instead.")]
        public bool Compact {
            get { return _compact; }
            set { _compact = value; }
        }

        /// <summary>
        /// Determines the type of delimiter to be used in this list.
        /// </summary>
        [Obsolete("Deprecated in HTML4 - use CSS instead.")]
        public TypeChoices? Type {
            get { return _type; }
            set { _type = value; }
        }

        /// <summary>
        /// Gets a formatted string of all local attributes of this element
        /// (not including the base attributes).
        /// </summary>
        /// <param name="sb">The StringBuilder to write this element's
        /// attribute data to.</param>
        protected override void WriteLocalAttributes(StringBuilder sb) {
            AttributeWriter.Write(sb, _compact, "compact");
            AttributeWriter.Write(sb, _type, "type", true);
        }
    }
}
